<?php
    function mydate($date)
    {
       $day=substr($date,8,2);
       $mymonth = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
       $month=substr($date,5,2);
       $year=substr($date,0,4);
       $temp=$day.' '.$mymonth[$month-1].' '.$year;
       return $temp;
    }

    if(!empty($jobseekers))
    {
        echo "<table cellpadding=0 cellspacing=0 style='border:none' class='mytable' >";
            echo "<tr><th width='40px'>ID</th> <th width='260px'>Name</th><th width='100px'>Gender</th><th width='180px'>Date of Birth</th><th width='100px'>Email</th><th width='120px'>Location</th><th width='120px'>Created</th><th width='175px'>Action</th></tr>";
            foreach($jobseekers as $data)
            {
            echo "</tr>";    
                echo "<td>".$data['jobseekers']['id']."</td>";
                echo "<td>".$data['jobseekers']['salution']." ".$data['jobseekers']['first_name']." ".$data['jobseekers']['last_name']."</td>";
                echo "<td>".$data['jobseekers']['gender']."</td>";
                echo "<td>".date("d-m-Y",strtotime($data['jobseekers']['date_of_birth']))."</td>";
                echo "<td><a href='mailto:".$data['jobseekers']['email']."'>".$data['jobseekers']['email']."</a></td>";
                echo "<td>".$data['cities']['name']."</td>";
                echo "<td>".mydate($data['jobseekers']['created'])."</td>";
                echo "<td>";
                echo $ajax->link('[ Edit ]',
                                    array('controller'=>'jobseekers','action'=>'edit_admin',$data['jobseekers']['id']),
                                    array('update'=>'slip','complete'=>"make_slip();",'class'=>'sky')
                                 );            
                echo "&nbsp";
                echo $ajax->link( '[ Delete ]', 
                        array('controller' => 'jobseekers', 'action' => 'delete_admin',$data['jobseekers']['id']),
                        array('update' => 'result','class'=>'sky'),
                        "Are you sure ?"
                        );                           
                echo "</td>";
            echo "</tr>";
            }
            echo "<tr class='end'><td class='end' colspan=8> &nbsp </td></tr>";
        echo "</table>";            
    }
    else
    { echo "<span class='red'>Sorry, there is no data in this category</span>"; }    
    echo "<div id='slip'></div>";  
?>